<template>
	<view class="setting-list">
		<view class="column-col">
			<text>设备号</text>
			<text>{{deviceId}}</text>
		</view>
		<view class="column-col">
			<text>检查更新</text>
			<text>版本 {{settingInfo.version}}</text>
		</view>
		<view class="column-col patch-other">
			<text class="stitle">基本信息 </text>
			<text>设备IP地址:{{userInfo.ipaddr}}</text>
			<text>软件版本: {{settingInfo.system}}</text>
			<text>MAC地址:{{macAddr}}</text>
			<text>人脸激活:</text>
		</view>
		<view class="button-col">
			<button class="button-footer-ok" @click="logOut">退出应用</button>
			<button class="button-footer-ok" @click="logOut">退出账号</button>
		</view>
		
				
	</view>
</template>

<script>
	import  {mapState} from 'vuex'
	//#ifdef APP-PLUS 
	const ToolKit = uni.requireNativePlugin('toolkit');
	//#endif
	export default {
		name:'SystemInfo',
		data(){
			return {
				settingInfo:{},
				macAddr:'',
				beginTime:'07:00',
				endTime:'22:00',
				currentKind:''
				
			}
		},
		computed:{
			...mapState(['userInfo','deviceId'])
		},
		methods:{
			getMacAddress() {
				//#ifdef APP-PLUS 
				ToolKit.getEthMac((res)=>{
					this.macAddr = res;
				})
				//#endif
			},
			getSettingInfo(){
				uni.getSystemInfo({
					success:(res)=>{
						this.settingInfo = res;
						this.$forceUpdate()
					}
				})
			},
			logOut(){
				uni.clearStorageSync();
				// 清除定时器
				clearInterval(getApp().globalData.timerFun);
				getApp().globalData.timerFun = null;	
				uni.navigateTo({
					url:'/pages/login/login'
				})
			}
		},
		mounted(){
			//#ifdef APP-PLUS 
			ToolKit.setCompleteConnectionListener((res)=>{
				this.getMacAddress()
			});
			//#endif
			this.getSettingInfo();
		}
	}
</script>

<style lang="scss" scoped>
	.setting-list {
		display: flex;
		flex-direction: column;
		
		margin-top:16.72upx;
		font-size:10.16upx;
		.column-col {
			min-height: 35.16upx;
			background: rgba(255,255,255,0.42);
			border-radius: 4.69upx;
			display: flex;
			justify-content: space-between;
			padding: 0 10.81upx;
			align-items: center;
			margin-bottom: 7.81upx;
			color: #333;
			&.patch-other {
				flex-direction: column;
				align-items: flex-start;
				line-height: 19.53upx;
				padding-top: 7.81upx;
				padding-bottom: 7.81upx;
				color: #8B8B8B;
			}
			.stitle {
				color: #333;
			}
		}
	}
	.button-col {
		display: flex;
		justify-content: center;
	}
	
	.form-list {
		margin-top:6.25upx;
		.col-td {
			display: flex;
			position: relative;
			height:15.63upx;
			border-bottom: 1px solid #ccc;
			margin-bottom: 1.95upx;
			font-size:9.25upx;
			height:21.53upx;
			line-height: 21.53upx;
			.ctitle {
				width:48upx;
			}
			input {
				width:80%;
				line-height: 20upx;
				height: 20upx;
				
				
			}
			
		}
	}
	
	.set-time-box {
		line-height: 15.63upx;
		display: flex;
		flex-direction: column;
	}
</style>